import {createRouter, createMemoryHistory} from 'vue-router'
import Layout from '../layouts/index.vue'

// 用工厂函数创建router实例
const router = createRouter({
  history:  createMemoryHistory(),  // 启用hash模式
  routes: [
    {
      path: '/',
      component: Layout,
      children: [
        {
          path: '/',
          component: () => import('../views/home.vue')
        }
      ]
    }
  ]
})

export default router